home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-12-16 | 4.4 KB | 127 lines | [TEXT/CWIE] |
- // ===========================================================================
- // CActiveXView.h ©1996 Microsoft Corporation. All rights reserved..
- // ===========================================================================
-
- #ifndef _H_CActiveXView
- #define _H_CActiveXView
- #pragma once
-
- #include <LView.h>
- #include <LCommander.h>
- #include <LAttachment.h>
- #include <LDragAndDrop.h>
-
- #include "HEADERS.H"
-
- class CActiveXAttachment;
- class CActiveXDocument;
- #ifdef MULTI_CONTEXT_TEST_APP
- class CActiveXShadowView;
- #endif // MULTI_CONTEXT_TEST_APP
- class CIdle;
-
- class CActiveXView : public LView,
- public LCommander,
- public LDragAndDrop,
- public CXSite
- {
-
- public:
- friend class CActiveXShadowView;
-
- enum { class_ID = 'ActX' };
- static CActiveXView* CreateActiveXViewStream(LStream *inStream);
-
- CActiveXView(void);
- CActiveXView(LStream *inStreamP);
- ~CActiveXView(void);
-
- // **** LView method overrides ***
- virtual void Click(SMouseDownEvent &inMouseDown);
- // these are tentative View Class Overrides
- virtual void ResizeFrameBy(Int16 inWidthDelta, Int16 inHeightDelta, Boolean inRefresh);
- virtual void MoveBy(Int32 inHorizDelta, Int32 inVertDelta, Boolean inRefresh);
- virtual void AdaptToNewSurroundings(void);
- virtual void AdaptToSuperFrameSize(Int32 inSurrWidthDelta, Int32 inSurrHeightDelta, Boolean inRefresh);
- virtual void ScrollImageBy(Int32 inLeftDelta, Int32 inTopDelta, Boolean inRefresh);
- virtual void ResizeImageBy(Int32 inWidthDelta, Int32 inHeightDelta, Boolean inRefresh);
- // end tentative
-
- // **** LCommander method overrides ***
- virtual Boolean HandleKeyPress(const EventRecord& inKeyEvent);
- virtual void DoEvent(EventRecord *inEvent, Boolean *outPassEventUp, Boolean *outRemoveAttachment);
-
- Boolean IsDirty(void) { return mDirty; };
- void SetDirty(Boolean Dirty) { mDirty = Dirty; };
-
- #ifdef MULTI_CONTEXT_TEST_APP
- // Support for multiple draw contexts
- void AddShadowView(CActiveXShadowView *inShadowView);
- void RemoveShadowView(CActiveXShadowView *inShadowView);
- void DrawShadowView(CActiveXShadowView *inShadowView, Boolean8 inUpdateContext);
- void ClickInShadowView(CActiveXShadowView* inShadowView, SMouseDownEvent &inMouseDown);
- #endif // MULTI_CONTEXT_TEST_APP
-
- // **** IContainerSite methods overrides ***
- //STDMETHOD_ (ULONG, Release)(void);
- STDMETHOD (AcquireContext) (THIS_ Uint32 inContextID, DrawContext* outContext);
- STDMETHOD (ReleaseContext) (THIS_ DrawContext* inContext);
- STDMETHOD (RequestFocus) (THIS_ Boolean8 inAcquire, FocusSet inFocus);
- STDMETHOD (RequestSizeChange) (THIS_ PlatformPoint* ioSize);
- STDMETHOD (SetIdleTime) (THIS_ Int32 WaitTicks, Uint32 IdleRefCon);
-
- protected:
- // LCommander Class Overrides
- virtual void FindCommandStatus( CommandT inCommand, Boolean &outEnabled,
- Boolean &outUsesMark, Char16 &outMark, Str255 outName );
- virtual Boolean ObeyCommand(CommandT inCommand, void *ioParam);
- virtual void DrawSelf();
- virtual void BeTarget();
- virtual void DontBeTarget();
-
- // Drag and Drop methods
- virtual Boolean ItemIsAcceptable( DragReference inDragRef, ItemReference inItemRef );
- virtual void ReceiveDragItem( DragReference inDragRef, DragAttributes inDragAttrs,
- ItemReference inItemRef, Rect &inItemBounds );
-
- // CActiveXView methods
- ErrorCode AcquireContext(LView* inView, DrawContext* outContext);
- LView *GetDrawingViewFromIndex(Int32 inContextIndex);
- LView *GetDrawingViewFromID(Uint32 inContextID);
- void UpdateDrawingContext(LView* inDrawView, ContextCommand inContextCommand);
-
- virtual Boolean8 GetContextID (Int32 inContextIndex, UInt32* outContextID);
-
- private:
- void CommonInit(void);
- void InstantiateControl(Char8 **inArgNames, Char8 **inArgValues, Int16 inArgCount);
- void InstantiateControl(FSSpecPtr inFileSpec);
- void RemoveControl(void);
- void HandleClick(SMouseDownEvent &inMouseDown);
- void AttachPort(Boolean inHasPort);
-
- CIdle *mStreamIdleP;
- CActiveXAttachment *mMouseUpAttachmentP;
- CActiveXDocument *mDocumentP;
- LArray *mViewArrayP;
- LArray *mPendingViewsP;
- LView *mActiveView;
- Boolean8 mInRequestFocus;
- Boolean8 mContextDirty;
- Boolean8 mDirty;
- };
-
-
- class CActiveXAttachment : public LAttachment
- {
- public:
- CActiveXAttachment( CActiveXView *inActiveXView );
- ~CActiveXAttachment();
-
- protected:
- CActiveXView *mActiveXView;
-
- void ExecuteSelf( MessageT inMessage, void *ioParam );
- };
-
- #endif